</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
<h2 class="u-tt">TAGS管理</h2>
	<div class="more"><a href="javascript:;" onClick="ajaxload();"><span class="icon">&#xf021;</span> 刷新</a></div>
    <ul>
        <li><a class="z-crt" href="<?php echo url('admin_list/index') ?>"><span class="icon">&#xf101;</span> TAG列表</a></li>
		<li><a href="<?php echo url('admin_category/index') ?>"><span class="icon">&#xf101;</span> TAG分类管理</a></li>
    </ul>
</div>
<div class="m-list-table">
<table class="m-table m-table-row tablesorter" id="table">
    <thead>
      <tr>
	  	<th width="50">选择</th>
        <th width="50">ID</th>
        <th>TAG名称</th>
		<th class="cola">分类</th>
		<th class="cola">引用次数</th>
		<th class="cola">访问量</th>
      </tr>
      
    </thead>
    <tbody>
    </tbody>
</table>
</div>
<div id="mobile" class="m-form" style="display:none; float:left">
<div class="f-sep10"></div>
<div class="f-sep10"></div>
	<select name="audit_cid"  id="audit_cid" >
		<option value="">======选择分类======</option>
		<!--foreach:{$class_list $vo}-->
        <option value="{$vo['cid']}">{$vo['name']}</option>
		</option>
		<!--{/foreach}-->
	</select>
	<button type="button"  onClick="audit(2);" class="u-btn u-btn-sm">确认</button>
</div>

<div class="f-cb"></div>
<div class="g-foot-tool">
	<div class="m-tools "> <span class="u-btns">
		<button type="button" onClick="selectall('id[]');"  class="u-btn u-btn-c4 u-btn-sm">全选</button>
		<button type="button" onClick="audit(1);" class="u-btn u-btn-c4 u-btn-sm">删除</button>
		<button type="button" onClick="$('#mobile').toggle();" class="u-btn u-btn-c4 u-btn-sm">分类</button>
		</span> </div>
	<div class="m-page" id="pages"></div>
</div>
<div class="f-cb"></div>

<div class="f-sep10" ></div>
<div class="f-sep10"></div>
</body>
<script>
var page;
var ajaxload = new function(){}; 
var selectall = new function(){}; 
var audit = new function(){}; 
Do.ready('base','page','tip','dialog', function() {
	page = $("#pages").myPagination({
		pageCount:1,
		ajax: {
			on: true,
			pageCountId:'countpage',
			url: '{$url(admin_list/ajax_content_list)}',
			dataType: 'json',
			param:$('#filter_form').serialize(),
			ajaxStart: function() {
				$("#table tbody").html('<tr><td colspan="7"><center>正在加载...请稍候！</center></td></tr>'); 
			},
			callback: function(json) {
				setTimeout(function() {
					$("#table tbody").html(json.info);
				}, 200);
			}
		}
	});
	
	window.ajaxload = function ajaxload(){
		page.onLoad({
			param:$('#filter_form').serialize()
		});
	};
	
	$(".images").powerFloat({
		targetMode: "ajax"
	});
	
	//选择
	window.selectall = function selectall(name){   
		$("[name='"+name+"']").each(function(){//反选   
		if($(this).attr("checked")){   
			  $(this).removeAttr("checked");   
		}else{   
			  $(this).attr("checked",'true');   
		}   
		})  
	}
	
	//批量操作
	window.audit = function audit(status){
		var str="";
		$("[name='id[]']").each(function(){//反选   
		if($(this).attr("checked")){
			  str+=$(this).val()+","; 
		}
		})
		ajaxpost({
			name:'您确认要继续进行操作吗？操作将无法撤销！',
			url:"{$url(admin_list/batch)}",
			data:{status: status, id:str, cid:$("#audit_cid").val()},
			tip:1,
			success:function(){
				ajaxload();	
			}
		});
	}

});


</script>